"""
求矩阵各行元素之和
"""
m, n = input().split()
for i in range(0, int(m)):
    list1 = list(map(int, input().split()))
    print(sum(list1))